﻿// EXP0521.cpp : 修改5.5.1节练习题的程序，使其找到的重复单词必须以大写字母开头。

#include <iostream>
#include <string>
using namespace std;

int main()
{
	string str, prestr = "";
	int count = 1;
	bool b = true;
	cout << "输入一串字符串：" << endl;
	while (cin >> str && !str.empty())
	{

		if (str == prestr&&isupper(str[0]))
		{
			cout << prestr << "重复出现" << endl;
			b = false;
			break;
		}
		prestr = str;
	}
	if (b)
	{
		cout << "任何单词都没有连续出现过" << endl;
	}
	return 0;
}


